com.supermap.ar.areffect

Class AREffectElement

  • java.lang.Object
    • com.supermap.ar.areffect.AREffectElement
    • Constructor Detail

      • AREffectElement

        public AREffectElement(android.content.Context context)
        Construction method
        Parameters:
        context - The context.
    • Method Detail

      • getId

        public long getId()
        Gets id
        Returns:
      • setElementName

        public void setElementName(java.lang.String objectName)
        Gets object's name
        Parameters:
        objectName -
      • addChild

        public boolean addChild(AREffectElement obj)
        Adds sub objects
        Parameters:
        obj - sub objects
        Returns:
        whether the adding is successful.
      • getChild

        public AREffectElement getChild(int index)
        Searches sub objects according to serial number
        Parameters:
        index - the sequence number
        Returns:
        Sub object.
      • removeChild

        public void removeChild(int index)
        Deletes sub objects
        Parameters:
        index -
      • removeChild

        public void removeChild(long id)
        Deletes sub objects
        Parameters:
        id -
      • removeChild

        public void removeChild(java.lang.String Name)
        Deletes sub objects
        Parameters:
        name -
      • clearAllChilds

        public void clearAllChilds()
        Clears all sub objects
      • getAllChilds

        public java.util.ArrayList<AREffectElement> getAllChilds()
        Gets the sub object array
        Returns:
      • addChilds

        public void addChilds(java.util.ArrayList<AREffectElement> list)
        Sets the sub object array
        Parameters:
        list -
      • getChildCount

        public int getChildCount()
        Gets the number of sub objects
        Returns:
      • getChild

        public java.util.ArrayList<AREffectElement> getChild(java.lang.String Name)
        Gets the sub objects
        Parameters:
        name -
        Returns:
      • getChild

        public AREffectElement getChild(long id)
        Gets sub objects according to their id
        Parameters:
        id -
        Returns:
      • getPosition

        public Point3D getPosition()
        Gets the position of AR object on the AR scene
        Returns:
      • setPosition

        public void setPosition(Point3D position)
        Sets the position of AR object on the AR scene
        Parameters:
        position -
      • getWGSCoordinates

        public Location getWGSCoordinates()
        Gets geographical position of model
        Returns:
      • setWGSCoordinates

        public void setWGSCoordinates(Location elementLocation)
        Sets model position using geographical coordinates
        Parameters:
        elementLocation -
      • getRelativePosition

        public Point3D getRelativePosition()
        Gets the position of AR object relative to its parent node
        Returns:
      • setRelativePosition

        public void setRelativePosition(Point3D position)
        Sets the position of AR object relative to its parent node
        Parameters:
        position -
      • getRotationAxis

        public Vector getRotationAxis()
        Returns rotating vector
        Returns:
      • getRotationAngle

        public float getRotationAngle()
        Returns the rotation angle
        Returns:
      • setRotationAngle

        public void setRotationAngle(Vector vector,
                                     float rotationAngle)
        Sets the rotation angle
        Parameters:
        vector - the rotation axis. you can use unit vector directly
        rotationAngle - the rotation angle
      • getScaleFactor

        public float[] getScaleFactor()
        Gets the ratio of object in ar world
        Returns:
      • setScaleFactor

        public void setScaleFactor(float[] scales)
        Sets the ratio of object in ar world
        Parameters:
        scales - including 3 values that are coefficients of x, y, and z
      • setParentNode

        public void setParentNode(EffectView arEffectView)
        Absolute layout. Sets parent nodes
        Parameters:
        arEffectView -
      • setParentNode

        public void setParentNode(EffectElement arEffectElement)
        Relative layout. Sets parent nodes
        Parameters:
        arEffectElement -
      • setVisiblity

        public void setVisiblity(boolean visiblity)
        Sets whether it is visible. The visibility of each sub object changes over the changes of parent objects
        Parameters:
        visiblity -
      • isVisible

        public boolean isVisible()
        Gets whether it is visible
        Returns:
      • isTransformable

        public boolean isTransformable()
      • setTransformable

        public void setTransformable(boolean isTransformable)
        Sets the model status (whether users can zoom and rotate models with gestures)
        Parameters:
        isTransformable -
      • removeOnTapListener

        public void removeOnTapListener()
        Removes the click listener
      • removeOnTouchListener

        public void removeOnTouchListener()
        Removes the touch listener
      • getElementType

        public ElementType getElementType()
        Get the element type
        Returns:
      • removeChild

        public void removeChild(AREffectElement element)
        Removes child node elements
        Parameters:
        element -
      • setLocalScaleFactor

        public void setLocalScaleFactor(float[] scales)
        Sets the scale of objects in the AR world
      • getLocalScaleFactor

        public float[] getLocalScaleFactor()
        Gets the scale of the object in the AR world
        Returns:
      • setRelativePosition

        public void setRelativePosition(Vector3 position)
        Sets the position of the AR object relative to the parent node * @param position
      • setShadowCaster

        public void setShadowCaster(boolean flag)
        Sets whether shadows can be cast in the scene
        Parameters:
        flag -
      • setShadowReceiver

        public void setShadowReceiver(boolean flag)
        Sets whether shadows from other objects can be accepted in the scene
        Parameters:
        flag -
      • isShadowCaster

        public boolean isShadowCaster()
        Determines whether the element can cast shadows in the scene
        Returns:
      • isShadowReceiver

        public boolean isShadowReceiver()
        Determines whether this element can accept shadows from other elements in the scene
        Returns:
      • destroy

        public void destroy()
        Destruction of objects
      • setRotateAlwaysToCamera

        public void setRotateAlwaysToCamera(boolean alwaysToCamera)
        Sets whether the attitude of the element is always relative to the camera position
        Parameters:
        alwaysToCamera -
      • setRotateToCameraType

        public void setRotateToCameraType(Node.RotateToCameraType type)
        Set the position of the node relative to the camera
        :
                 Horizontal,
                 Vertical,
                 Horizontal_Vertical
        Parameters:
        type -
      • setParentNode

        public AREffectElement setParentNode(EffectView arEffectView,
                                             Node parent)
        Binds elements to other nodes in the view

        Parameters:
        arEffect - View View parameter.
        parent - Node
              Use this method to bind elements directly to nodes
              IfEffectViewis not null,hen the binding relation:AREffectElement->parentNode->EffectView
         
        Returns: